package com.ulic.customerManApplication.util.job;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.ulic.customerManApplication.commonmodule.service.OrganizationService;
import com.ulic.customerManApplication.servlet.GetSpringBeanServlet;

/**
 * ReloadOrganizationTreeJob.java
 * Description: 重新加载机构树
 * Copyright (c) Department of Research and Development/Beijing/北京中科汇联信息技术有限公司.
 * All Rights Reserved.
 * @version 1.0  
 * 2012-9-17 上午11:04:19 李求智 (liqz@huilan.com) created
 */
public class ReloadOrganizationTreeJob implements Job{

	

	private static Logger log = Logger.getLogger(ReloadOrganizationTreeJob.class);
	
	private static OrganizationService organizationService = (OrganizationService)GetSpringBeanServlet.getBean("organizationService");
	/**
	 * Description: 重新加载机构树
	 * @Version1.0 
	 * 2012-9-17 上午11:04:17 李求智 (liqz@huilan.com) created
	 * @param arg0
	 * @throws JobExecutionException
	 */
	@Override
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		try {
			//调用加载机构树的接口
			log.debug("ReloadOrganizationTreeJob begin...");
			organizationService.reloadOrganizationTree();
			log.debug("ReloadOrganizationTreeJob end");
		} catch (Exception e) {
			e.printStackTrace();
			log.debug("ReloadOrganizationTreeJob run error");
		}
	}

	
}
